﻿<phone:PhoneApplicationPage 
    x:Class="EbbinghausWord.Pages.ReviewWordPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:c4f="clr-namespace:Coding4Fun.Phone.Controls;assembly=Coding4Fun.Phone.Controls"
    xmlns:Converters="clr-namespace:Coding4Fun.Phone.Controls.Converters;assembly=Coding4Fun.Phone.Controls"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:my1="clr-namespace:EbbinghausWord.Controls" mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    
    Loaded="PhoneApplicationPage_Loaded"
    Unloaded="PhoneApplicationPage_Unloaded" 
    shell:SystemTray.IsVisible="True">
    <phone:PhoneApplicationPage.Resources>
        <Style x:Key="normalButton" TargetType="Button">
            <Setter Property="Height" Value="100"/>
        </Style>

        <Style x:Key="smallTitleTextBlock" TargetType="TextBlock">
            <Setter Property="FontSize" Value="20"/>
            <Setter Property="TextAlignment" Value="Right"/>
        </Style>
    </phone:PhoneApplicationPage.Resources>

    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="70"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="150"/>
        </Grid.RowDefinitions>

        <!--标题栏-->
        <Grid x:Name="TitlePanel" Grid.Row="0" Margin="12,0,12,0" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <TextBlock x:Name="ApplicationTitle" Text="{StaticResource appTitle}" 
                       Style="{StaticResource PhoneTextNormalStyle}" Grid.ColumnSpan="2" 
                       Margin="0" />
            <TextBlock Name="wordbookTextBlock" Grid.Row="1" Grid.Column="0" 
                       Text="学习/复习" TextAlignment="Center"
                       Style="{StaticResource smallTitleTextBlock}"/>
            <TextBlock Name="remeberLevelTextBlock" Grid.Row="1" Grid.Column="1" 
                       Text="1/20" Style="{StaticResource smallTitleTextBlock}"/>
            <TextBlock Name="totalTextBlock" Grid.Row="0" Grid.Column="1" 
                       Text="1000/4000" Style="{StaticResource smallTitleTextBlock}"/>
        </Grid>

        <!--单词内容区域-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12">
            <ScrollViewer VerticalScrollBarVisibility="Visible">
                <StackPanel Margin="12" ScrollViewer.VerticalScrollBarVisibility="Visible">
                    <Grid HorizontalAlignment="Center" MouseLeftButtonDown="voiceImage_MouseLeftButtonDown">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="60"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Name="workTextBlock" TextAlignment="Center"
                                FontSize="48" Text="{Binding Path=English}"/>
                        <Image x:Name="voiceImage" Grid.Column="1" Source="/Images/voice.png" Height="48" Width="48" />
                    </Grid>
                    <!--<Button x:Name="playButton"  Click="playButton_Click">
                        <Button.Content>
                        </Button.Content>
                    </Button>-->
                    <MediaElement x:Name="MainME" AutoPlay="False" Volume="1" MediaFailed="MainME_MediaFailed"
                                  MediaOpened="MainME_MediaOpened" MediaEnded="MainME_MediaEnded"></MediaElement>

                    <StackPanel Margin="12,48,12,12" >
                        <StackPanel Name="chinesePanel" Visibility="Collapsed" 
                                    ManipulationDelta="chinesePanel_ManipulationDelta"
                                    MouseLeftButtonUp="chinesePanel_MouseLeftButtonUp"
                                    MouseLeftButtonDown="chinesePanel_MouseLeftButtonDown"
                                Background="Green">
                            <TextBlock Name="soundmarkTextBlock" Margin="0"  TextAlignment="Center"
                                FontSize="24" Text="{Binding Path=Soundmark}"/>
                            <TextBlock Name="chineseTextBlock" Margin="12" TextWrapping="Wrap" 
                               FontSize="24" Text="{Binding Path=Chinese}"/>
                        </StackPanel>

                        <Button Name="ShowChineseButton" Grid.Column="1" Height="200" Width="300" 
                                    Content="显示中文" Click="ShowChinese_Click" />
                        <!--<Button Name="TestButton" Content="对比" Click="TestButton_Click"/>-->

                    </StackPanel>
                </StackPanel>
            </ScrollViewer>
        </Grid>

        <!--按钮栏-->
        <Grid Name="buttonPanel" Grid.Row="2" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Button Name="ForgetWordButton" Grid.Column="0" Content="没记住"  Style="{StaticResource normalButton}" Click="ForgetWordButton_Click" />
            <Button Name="RemeberWordButton" Grid.Column="1" Content="记住了" Style="{StaticResource normalButton}" Click="RemeberWord_Click" />
        </Grid>
        
        <my1:HintControl Grid.RowSpan="3" x:Name="hintControl"/>

    </Grid>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton x:Name="removeWordBarIconButton" IconUri="/Images/remove.png" Text="排除单词" Click="CompleteRemeberButton_Click"/>
            <shell:ApplicationBarIconButton x:Name="studyAchievementBarIconButton" IconUri="/Images/achievement.png" Text="学习成果" Click="studyAchievementBarIconButton_Click"/>
            <shell:ApplicationBarIconButton x:Name="scoreBarIconButton" IconUri="/Images/score.png" Text="预测成绩" Click="scoreBarIconButton_Click"/>
            <!--<shell:ApplicationBarIconButton x:Name="testButton" Text="测试" IconUri="/Images/test.png" Click="testButton_Click"/>-->
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="设置" Click="OptionClick"/>
                <shell:ApplicationBarMenuItem Text="极速背单词" Click="ad_Click"/>
                <shell:ApplicationBarMenuItem Text="关于" Click="AboutClick"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>